'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let {
		username,score,right,err,all
	} = event
	let day =new  Date()
	let create_date = day.toLocaleString()
	
	uniCloud.database().collection('scorelog').add({
		username,score,right,err,all,create_date,create_time:Date.now()
	})
	//返回数据给客户端
	return 'ok'
};
